package com.wxm.eum;

/**
 * <p>
 *      支付场景枚举
 * </p>
 *
 * @author: wxm
 * @Date: 2023/4/7
 */
public enum PaySceneEnum {
        WX_APPLET(1,"小程序微信支付"),
        WX_BROWSER(2,"H5-微信浏览器支付"),
        WX_SCAN(3,"H5-浏览器微信扫码支付"),
        WX_JS(4,"APP-微信JS支付"),
    ;
    private Integer code;
    private String msg;

    PaySceneEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }
    public Integer getCode() {
        return code;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public void setCode(Integer code) {
        this.code = code;
    }

    public static PaySceneEnum getByCode(Integer code){
        PaySceneEnum[] enums = PaySceneEnum.class.getEnumConstants();
        for (PaySceneEnum anEnum : enums) {
            if (anEnum.code.equals(code)){
                return anEnum;
            }
        }
        return null;
    }
}
